class Solution {
public:
    int bulbSwitch(int n) {
        int ret=0;
        int ans=1;
        while(ans*ans<=n)
        {
            ret++;
            ans++;
        }
        return ret;
    }
};
